/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package model;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;

/**
 *
 * @author markh_000
 */
public class Listeners {
    private ArrayList<ActionListener> listeners;


    public Listeners() {
        listeners = new ArrayList<>();

    }

    public void addListener(ActionListener listener) {
        listeners.add(listener);

    }

    public void notifyListeners(String event) {
        for (ActionListener actionListener : listeners) {
            actionListener.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, event));
        }

    }
}
